package com.example.demobean.bean;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;

/**
 * 参考来自：https://blog.csdn.net/yaomingyang/article/details/84347822
 */
@Service
public class BeanTest {
    @Bean(name = "my-bean-test") //不自定义名称的话默认名称就是 "getBean"
    public  BeanTest getBean(){
        BeanTest bean = new BeanTest();
        System.out.println("调用方法："+bean);
        return bean;
    }
}
